import React from 'react'
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { getbuslist, getsplist } from '../../redux/actionCreator'
import ShowList from './ShowList';

class List extends React.Component {
    constructor(props) {
        super(props)
        this.props.dispatch(getsplist());
        this.props.dispatch(getbuslist());
    }

    render() {
        return (
            <div>
                <ShowList kind={this.props.kind} money={this.props.money}/>
                <div style={{height:'45px'}}></div>
            </div>
        )
    }
}

const mapStateToProps = (state) => ({
    shop: state.shop,
    business: state.business
})

export default withRouter(connect(mapStateToProps)(List))